package novel.manager.service.utils;

import novel.manager.pojo.spider.NovelSiteEnum;
import novel.manager.service.iface.spider.novel.INovelSpider;
import novel.manager.service.impl.spider.novel.BxwxNovelSpider;
import novel.manager.service.impl.spider.novel.KanShuZhongNovelSpider;

/**
 * 生产书籍列表的实现类
 */
public final class NovelSpiderFactory {
	private NovelSpiderFactory() {}
	//小说列表页面
	public static INovelSpider getNovelSpider(String url) {
		NovelSiteEnum novelSiteEnum = NovelSiteEnum.getEnumByUrl(url);
		switch (novelSiteEnum) {
		case Bxwx : return new BxwxNovelSpider();
		case KanShuZhong : return new KanShuZhongNovelSpider();
		default : throw new RuntimeException(url + "暂时不被支持");
		}
	}
}
